///统计公共类
class CountModel {
  List<CarInfoCount> timeDate; //日期
  List<CarCountInfoEntityData> data;

  CountModel({this.timeDate, this.data});

  CountModel.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = new List<CarCountInfoEntityData>();
      (json['data'] as List).forEach((v) {
        data.add(new CarCountInfoEntityData.fromJson(v));
      });
    }

    if (json['timeDate'] != null) {
      timeDate = new List<CarInfoCount>();
      (json['timeDate'] as List).forEach((v) {
        timeDate.add(new CarInfoCount.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();

    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }

    if (this.timeDate != null) {
      data['timeDate'] = this.timeDate.map((v) => v.toJson()).toList();
    }

    return data;
  }
}

//车辆统计信息
class CarCountInfoEntityData {
  String license; //车牌号码
  List<CarInfoCount> data;

  CarCountInfoEntityData({this.license, this.data});

  CarCountInfoEntityData.fromJson(Map<String, dynamic> json) {
    license = json['license'];

    if (json['data'] != null) {
      data = new List<CarInfoCount>();
      (json['data'] as List).forEach((v) {
        data.add(new CarInfoCount.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['license'] = this.license;

    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

//统计时间信息
class CarInfoCount {
  String timeDate; //车牌号码
  double consumptionValue;//耗油量

  CarInfoCount({this.timeDate,this.consumptionValue});

  CarInfoCount.fromJson(Map<String, dynamic> json) {
    timeDate = json['timeDate'];
    consumptionValue = json['consumptionValue'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['timeDate'] = this.timeDate;
    data['consumptionValue'] = this.consumptionValue;
    return data;
  }
}

